﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Hired1Div.master" AutoEventWireup="true"
    CodeBehind="manage.aspx.cs" Inherits="Hired.employer.manage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <style type="text/css">
        .gvQuestions
        {
            width: 90%;
            margin: 0 auto;
            padding: 2px;
            text-align: center;
            border-bottom: 1px solid #B8B58A;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPlaceHolder" runat="server">
    <span class="identifier"><a href="../settings.aspx">Account Settings</a> &gt;&gt; Manage
        Employer Passports</span>
    <br />
    <br />
    <contenttemplate>
            <asp:GridView ID="gvQuestions" runat="server" 
        AutoGenerateColumns="False" CssClass="gvQuestions"
                DataKeyNames="EPassportID" DataSourceID="eds" AllowPaging="True" 
                AllowSorting="True" onrowcommand="gvQuestions_RowCommand" 
        AlternatingRowStyle-BackColor="#CCCCFF" CellPadding="10" GridLines="Horizontal">
<AlternatingRowStyle BackColor="#CCCCFF"></AlternatingRowStyle>
                <Columns>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username"
                        ReadOnly="True" />
                    <asp:BoundField DataField="FirstName" HeaderText="First Name" 
                        SortExpression="FirstName" />
                    <asp:BoundField DataField="LastName" HeaderText="Last Name" 
                        SortExpression="LastName" />
                    <asp:BoundField DataField="Email" HeaderText="E-mail" SortExpression="Email" ReadOnly="True" />
                    <asp:CheckBoxField DataField="Administrator" HeaderText="Administrator?" />
                    <asp:TemplateField ShowHeader="False" HeaderText="Delete">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="../images/deleteicon.png"
                                CausesValidation="False" CommandName="Delete" CommandArgument='<%# Eval("EPassportID") %>' />
                            <asp:Panel ID="pnlDeletePopup" runat="server" CssClass="modalPopup">
                                Are you sure you wish to delete employer passport
                                <asp:Label ID="lblUsername" runat="server" Text='<%# Eval("Username") %>' />?
                                <br />
                                <br />
                                <asp:Button ID="btnCancel" Style="float: right" runat="server" Text="Cancel" />
                                <asp:Button ID="btnConfirm" Style="float: right; margin-right: 25px;" runat="server"
                                    Text="OK" />
                                <br />
                                <asp:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" ConfirmText=""
                                    Enabled="True" TargetControlID="btnDelete" DisplayModalPopupID="DeleteModalPopupExtender">
                                </asp:ConfirmButtonExtender>
                                <asp:ModalPopupExtender ID="DeleteModalPopupExtender" runat="server" TargetControlID="btnDelete"
                                    DropShadow="True" PopupControlID="pnlDeletePopUp" CancelControlID="btnCancel"
                                    OkControlID="btnConfirm" BackgroundCssClass="modalBackground">
                                </asp:ModalPopupExtender>
                            </asp:Panel>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#9933FF" ForeColor="White" HorizontalAlign="Center" />
                <PagerStyle BackColor="#9900FF" />
                <RowStyle BorderStyle="Outset" HorizontalAlign="Left" VerticalAlign="Middle" />
            </asp:GridView>
            <asp:EntityDataSource ID="eds" runat="server" ConnectionString="name=hireddbEntities"
                DefaultContainerName="hireddbEntities" EnableDelete="True" EnableFlattening="False"
                EnableUpdate="True" EntitySetName="EmployerPassports" Where="it.CAccountID == @id">
                <WhereParameters>
                    <asp:ControlParameter ControlID="gvQuestions" DbType="String" DefaultValue="" Name="id"
                        PropertyName="SelectedValue" />
                </WhereParameters>
            </asp:EntityDataSource>
        </contenttemplate>
</asp:Content>
